#pragma once

#include "controlcenter_global.h"
#include <osg/ref_ptr>
#include "MainManipulator.h"

namespace osg
{
	class Camera;
}

namespace ControlCenter
{
	class CONTROLCENTER_EXPORT PlaneManipulator: public MainManipulator
	{
	public:
		PlaneManipulator(osg::Camera* maincamera);
		void setMainCamera(osg::Camera* camera)
		{
			_mainCamera = camera;
		}
		virtual void mouseClick(const osgGA::GUIEventAdapter* ea0,const osgGA::GUIEventAdapter* ea1,
			const osgGA::GUIEventAdapter* key0,const osgGA::GUIEventAdapter* key1);
		virtual void mouseRelease(const osgGA::GUIEventAdapter* ea0,const osgGA::GUIEventAdapter* ea1,
			const osgGA::GUIEventAdapter* key0,const osgGA::GUIEventAdapter* key1);
		virtual void mouseMove(const osgGA::GUIEventAdapter* ea0,const osgGA::GUIEventAdapter* ea1);
		virtual void enableManipulator();
		virtual void disenableManipulator();
		virtual void setToolAction(ActionData* action);
	protected:
		virtual ~PlaneManipulator();
		void refreshActor(bool end);
		virtual void keyDown(const osgGA::GUIEventAdapter* ea0,osgGA::GUIActionAdapter& us);
		osg::Camera*									_mainCamera;
		osg::Vec3										_mouseCurrentpos;
		std::vector<osg::Vec3>							_vertexVector;
	};
}